package org.red5.core;

import org.red5.server.api.IScope;
import org.red5.server.api.IConnection;
import org.red5.server.api.Red5;
import org.red5.server.api.stream.IStreamPublishSecurity;

public class AuthNamePublishSecurity implements IStreamPublishSecurity {

	@Override
	public boolean isPublishAllowed(IScope scope, String name, String mode) {
		if (!"live".equals(mode)) {
            // Not a live stream
            return false;
        }
		if  (!name.startsWith("liveStream")){
            return false;
        } else {
        	name.replace("liveStream", "");
        	System.out.println(name);
            return true;
        }
    };


}
